//
//  EmotionModel.swift
//  weibobbaj
//
//  Created by Tiffany宝 on 16/4/27.
//  Copyright © 2016年 Tiffany. All rights reserved.
//

import UIKit

let EmotionKeyboardCol = 7
let EmotionKeyboardRow = 3
let EmotionKeyboardItemCount = EmotionKeyboardCol * EmotionKeyboardRow - 1

class EmotionModel: NSObject , NSCoding{
    
    //默认/浪小花 表情
    var chs: String?
    
    //emoji 表情
    var code: String?
    
    //1 为emoji / 0 为默认/浪小花
    var type: String?
    
    // 默认/浪小花 图片
    var png: String?
    
    //当前表情属于哪个文件夹
    var folderName: String?
    
    init(dic:[String : AnyObject]) {
        
        super.init()
        
        setValuesForKeysWithDictionary(dic)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {}
    
    //解档
    required init?(coder decoder: NSCoder) {
        
        chs = decoder.decodeObjectForKey("chs") as? String
        code = decoder.decodeObjectForKey("code") as? String
        type = decoder.decodeObjectForKey("type") as? String
        png = decoder.decodeObjectForKey("png") as? String
        folderName = decoder.decodeObjectForKey("folderName") as? String
    }
    
    //归档
    func encodeWithCoder(encoder: NSCoder) {
        
        encoder.encodeObject(chs, forKey: "chs")
        encoder.encodeObject(code, forKey: "code")
        encoder.encodeObject(type, forKey: "type")
        encoder.encodeObject(png, forKey: "png")
        encoder.encodeObject(folderName, forKey: "folderName")
    }
    
}




